﻿using System.Collections.Generic;

namespace OscarClover.Packets.SnacData
{
    public class CliFamiliesVersions : Snac
    {
        public CliFamiliesVersions(IEnumerable<byte> families) : base(0x01, 0x17)
        {
            FamiliesVersion = new Dictionary<byte, byte>();
            foreach (var family in families)
            {
                switch (family)
                {
                    case 0x13:
                    case 0x1:
                        FamiliesVersion.Add(family, 0x4);
                        break;
                    case 0x22:
                    case 0x15:
                    case 0xB:
                    case 0xA:
                    case 0x9:
                    case 0x6:
                    case 0x4:
                    case 0x3:
                    case 0x2:
                        FamiliesVersion.Add(family, 0x1);
                        break;
                }
            }
            Len += (ushort) (FamiliesVersion.Count*4);
        }

        public Dictionary<byte, byte> FamiliesVersion { get; set; }
    }
}